package st.yushao.restaurant.action.custom;

import java.util.List;

import st.yushao.restaurant.dao.FoodDaoService;
import st.yushao.restaurant.fw.AbstractBaseAction;
import st.yushao.restaurant.vo.FoodVO;

public class GetFoodsList extends AbstractBaseAction {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 963057261835230038L;

    /**
     * FoodDaoService
     */
    private FoodDaoService fds;

    /**
     * foodTypeId
     */
    private int foodTypeId;

    private List<FoodVO> foods;

  /**
   * getter of foods
   */
  public List<FoodVO> getFoods() {
    return foods;
  }

    public FoodDaoService getFds() {
        return fds;
    }
    public void setFds(FoodDaoService fds) {
        this.fds = fds;
    }
    public int getFoodTypeId() {
        return foodTypeId;
    }
    public void setFoodTypeId(int foodTypeId) {
        this.foodTypeId = foodTypeId;
    }

    /**
     * get the Foods list of the foodTypeId from food table
     * @return getFoodslist of the foodTypeId
     */
    public String doExecute() {
        // getFoodListByType
        foods = fds.getFoodListByType(foodTypeId);
        return SUCCESS;
    }
}
